package cn.itcast.bos.dao.base;

import java.util.Date;
import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import cn.itcast.bos.domain.base.Standard;

public interface StandardRepository extends JpaRepository<Standard, Integer>{
	//Query等值查询功能
	public List<Standard> findByName(String name);
	
	//Query模糊查询
	public List<Standard> findByNameLike(String name);
	
	public List<Standard> findById(Integer id);
	
	//基于两列等值查询
	public List<Standard> findByMinWeightAndMaxWeight(Integer minWeight,Integer maxWeight);
	
	//修改数据
	@Query(value="update Standard set minLength=? where id=?")
	@Modifying
	public void updateData(Integer num,Integer id);
	
	//插入数据
//	@Query(value="insert into Standard open (?,?,?,?,?,?,?,?,?)")
//	@Modifying
//	public void insertData(Integer id,String name,Integer minWeight,Integer maxWeight,Integer minLength,
//			Integer maxLength,Date operatingTime,String operator,
//			String operatingCompany);
}
